<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../../../js/plugins/layui-v2.4.5/layui/css/layui.css" />
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/list.css" />
	</head>
	<body class="p10">
		<div class="container p15">
			<div class="btn-container"><a href="javascript:;" id="addBtn" class="layui-btn layui-btn-sm">添加</a></div>
			<table id="list" lay-filter="list"></table>
		</div>
		<script src="../../../js/jquery-3.3.1.min.js"></script>
		<script src="../../../js/plugins/layui-v2.4.5/layui/layui.js"></script>
		<script src="../../../js/common.js"></script>
		<script>
			var data = [{"id":"b42a304a3837c36911e7886e4ccc6a41","modified":"2018-09-04","roleDesc":"系统管理员","roleName":"系统管理员","sortNumber":0},{"id":"0d5bb3547df34354965fc75d72b132fb","modified":"2018-09-04","roleDesc":"整个分店所有权限","roleName":"分店负责人","sortNumber":1},{"id":"6a4b42a304a3837c36911e7886e4ccc1","modified":"2018-11-21","roleDesc":"分店所有客户都可见，但只能操作自己的客户","roleName":"业务员","sortNumber":2},{"id":"48f5b6926d824a8abc2ea2f9e4448562","modified":"2018-09-04","roleDesc":"所有分店只读权限","roleName":"公司领导","sortNumber":3},{"created":"2018-11-15","creater":"admin","id":"47119d536c08420d843b41a55c0208b5","modified":"2018-11-15","roleDesc":"分店财务负责人，","roleName":"分店财务负责人","sortNumber":4},{"created":"2018-12-19","creater":"admin","id":"eca39ffe186c46fba8a546f476e7c025","modified":"2018-12-19","roleDesc":"管理所有分店，权限仅次于管理员","roleName":"空间负责人","sortNumber":5}];
			layui.use(['table'],function(){
				var table = layui.table;
				//第一个实例
				  table.render({
					elem: '#list'
					,height: '300'
					,url: '' //数据接口
					,page: true //开启分页
					,cols: [[ //表头
					  	{
					  		field: 'xh',
					  		title: '序号',
					  		width: 80,
					  		align: 'center',
					  		templet: function(d) {
					  			return d.LAY_INDEX;
					  		}
					  	}, {
					  		field: 'roleName',
					  		title: '角色名称',
					  		align: 'center'
					  	}, {
					  		field: 'roleDesc',
					  		title: '角色描述',
					  		align: 'center'
					  	}, {
					  		field: 'sortNumber',
					  		title: '排序',
					  		align: 'center'
					  	}, {
					  		field: 'opt',
					  		title: '操作',
					  		width: 160,
					  		align: 'center',
					  		templet: function(d) {
					  			return `<a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>
					  					  &nbsp;<a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>`
					  		}
					  	}
					]]
					,data:data
				  });
			})
			$(function(){
				$("#addBtn").click(function(){
					openLayer('role_add.html','角色新增','600px','360px');
				})
			})
		</script>
	</body>
</html>
